package net.cathackers.devel.scmp.auth.interfaces;

import net.cathackers.devel.scmp.auth.exceptions.AuthenticationException;
import net.cathackers.devel.scmp.auth.exceptions.ProxyException;
import net.cathackers.devel.scmp.exceptions.BackendConnectException;
import net.cathackers.devel.scmp.exceptions.BackendException;

/**
 * a delegator for all authentication operations.
 * @author ahmed soliman
 *
 */
public interface Authenticator extends AuthenticationOperations, AuthenticationManagement {
    /**
     * connect to the authenticator 
     * @throws BackendException 
     * @throws ProxyException 
     */
    void connect() throws BackendException, ProxyException;
    /**
     * are we connected to the authenticator?
     * @return
     * @throws ProxyException 
     */
    boolean isConnected() throws ProxyException;
    /**
     * check if the connection is "alive"
     * @return
     * @throws BackendConnectException 
     * @throws BackendException 
     * @throws AuthenticationException 
     */
    boolean isAlive() throws BackendConnectException, BackendException, AuthenticationException; 
    /**
     * disconnect from the authenticator
     * @throws ProxyException
     * @throws BackendException
     */
    public void disconnect() throws BackendException, ProxyException;
    
}
